package com.guoxin.designpattern.chapter8;

import java.lang.reflect.AnnotatedArrayType;

/**
 * @author guoxin
 * @date 2019/9/5
 */
public class FutureService {

    public <T> Future<T> submit(final FutureTask<T> task){
        AsynFutures<T> asynFutures = new AsynFutures<>();
        new Thread(()->{
            T result = task.call();
            asynFutures.done(result);
        }).start();
        return asynFutures;
    }
}
